Ext.define('DCApp.view.img.Panel', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.imgpanel',
    requires: [
         'DCApp.view.img.ListModel',
	     'Ext.data.*',
	     'Ext.util.*',
	     'Ext.view.View',
	     'Ext.ux.DataView.DragSelector',
	     'Ext.ux.DataView.LabelEditor'
     ],   
      cls: 'images-view',
      scrollable: false,
      layout:'fit',
      header:false,
      viewModel: {
          type: 'imagelist'
      },
      controller: 'imglist',

      tbar: ['->',{
	    	xtype:'fileupload',
	    	multiple:true,
	    	accept:"image/png, image/jpeg",
	    	entity_to:'Image'
	  },{
	      text: '编辑',
	      handler: 'onEdit'
	  },{
    	  text: '关联',
    	  handler: 'onRelList'
      },{
          text: '删除',
          handler: 'onRemove'
      }],
      
     items: {
    	 xtype:'imageview',
         bind: {
             store: '{objs}'
         }
     },
    initComponent: function() {   
    	if(this.config.bind){
    		Ext.apply(this, {
    			items:{
    		    	 xtype:'imageview',
    		         bind: this.config.bind	
    			}
    		});
    	}
        this.callParent(arguments);
    	if(DCApp.Cfg.bView){
			var tbar = this.down('toolbar');
			tbar.hide();
		}    		
    }
});